﻿using UnityEngine;
using System.Collections;

public class Logo : MonoBehaviour {
	public GameObject[] sprite;

	// Use this for initialization
	void Start () {
		UnityLogo();
		OR1GOLogo();
		StartCoroutine(LoadLevel());
	}

	private void UnityLogo(){
		iTween.FadeFrom(sprite[0], iTween.Hash("alpha", 0f, "time", 3f, "oncomplete", 
		                                       "Complete", "oncompleteparams", 0, 
		                                       "oncompletetarget", gameObject));
	}

	private void OR1GOLogo(){
		iTween.FadeFrom(sprite[1], iTween.Hash("delay", 6.2f, "alpha", 0f, "time", 
		                                       3f, "oncomplete", "Complete", 
		                                       "oncompleteparams", 1, "oncompletetarget", gameObject));

	}

	private void Complete(int i){
		iTween.FadeTo(sprite[i], 0f, 3f);
	}
	private IEnumerator LoadLevel(){
		yield return new WaitForSeconds(14.0f);
		Application.LoadLevel("Welcome");
	}
	// Update is called once per frame
	void Update () {
	
	}
}
